//package com.cqrt.service.impl;
//import java.util.Objects;
//
//import com.cqrt.mapper.RTProjectMapper;
//import com.cqrt.mapper.RTTaskMapper;
//import com.github.pagehelper.PageInfo;
//import com.github.pagehelper.page.PageMethod;
//import com.hustcad.plm.rpm.model.dto.job.TyppmJobDTO;
//import com.ty.ppm.model.dto.job.ExecuteJobDTO;
//import com.ty.ppm.model.dto.job.JobDTO;
//import com.ty.ppm.model.entity.job.Job;
//import com.ty.ppm.service.mapper.job.JobMapper;
//import com.ty.ppm.service.service.impl.job.JobServiceImpl;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.BeanUtils;
//import org.springframework.context.annotation.Primary;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//import java.math.BigInteger;
//import com.baomidou.mybatisplus.core.conditions.interfaces.Compare;
//import java.util.ArrayList;
//import java.util.List;
////
//// Source code recreated from a .class file by IntelliJ IDEA
//// (powered by FernFlower decompiler)
////
//
//
//import cn.hutool.core.collection.CollUtil;
//import cn.hutool.core.date.DateTime;
//import cn.hutool.core.text.CharSequenceUtil;
//import com.baomidou.mybatisplus.core.conditions.Wrapper;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//import com.github.pagehelper.PageInfo;
//import com.github.pagehelper.page.PageMethod;
//import com.ty.basic.configconstants.CommonConfigurationConstants;
//import com.ty.basic.entity.CTyEntityBaseDO;
//import com.ty.basic.entity.org.UserDO;
//import com.ty.basic.session.TyAccountContext;
//import com.ty.ppm.api.service.admin.ProjectService;
//import com.ty.ppm.api.service.deliverlink.JobDeliverLinkService;
//import com.ty.ppm.api.service.folder.FolderActiveLinkService;
//import com.ty.ppm.api.service.job.JobCheckItemService;
//import com.ty.ppm.api.service.job.JobCheckLinkService;
//import com.ty.ppm.api.service.job.JobDeliverService;
//import com.ty.ppm.api.service.job.JobService;
//import com.ty.ppm.api.service.message.ObjectSendMessageLinkService;
//import com.ty.ppm.api.service.operationrecord.OperationRecordService;
//import com.ty.ppm.api.service.org.MemberLinkService;
//import com.ty.ppm.api.service.plan.PlanActiveOperateService;
//import com.ty.ppm.api.service.plan.PlanActiveService;
//import com.ty.ppm.api.service.remote.RemoteObjectIdService;
//import com.ty.ppm.model.constant.PageConstant;
//import com.ty.ppm.model.constant.ValueConfigConstant;
//import com.ty.ppm.model.dto.admin.ProjectReqDTO;
//import com.ty.ppm.model.dto.job.CheckBatchJobDTO;
//import com.ty.ppm.model.dto.job.ExecuteJobDTO;
//import com.ty.ppm.model.dto.job.JobDTO;
//import com.ty.ppm.model.dto.job.JobQueryDTO;
//import com.ty.ppm.model.dto.plan.PlanActivePublishDTO;
//import com.ty.ppm.model.dto.remote.DeliverRemoteDTO;
//import com.ty.ppm.model.dto.team.ProjectTeamTreeDTO;
//import com.ty.ppm.model.dto.team.TeamTreeDTO;
//import com.ty.ppm.model.entity.admin.Project;
//import com.ty.ppm.model.entity.job.CheckItem;
//import com.ty.ppm.model.entity.job.Job;
//import com.ty.ppm.model.entity.job.JobCheckLink;
//import com.ty.ppm.model.entity.job.JobDeliverLink;
//import com.ty.ppm.model.entity.plan.PlanActive;
//import com.ty.ppm.model.entity.remote.RemoteObject;
//import com.ty.ppm.model.qc.OperationRecordQC;
//import com.ty.ppm.model.utils.ListUtils;
//import com.ty.ppm.model.utils.ParamValidateUtils;
//import com.ty.ppm.model.utils.Tools;
//import com.ty.ppm.model.utils.TyppmBatchQueryHelper;
//import com.ty.ppm.model.vo.job.JobVO;
//import com.ty.ppm.model.vo.job.StatisticsJobVO;
//import java.time.LocalDateTime;
//import java.util.Collections;
//import java.util.Date;
//import java.util.HashMap;
//import java.util.Iterator;
//import java.util.Map;
//import java.util.Objects;
//import java.util.stream.Collectors;
//import org.apache.commons.collections4.CollectionUtils;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.commons.lang3.math.NumberUtils;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.transaction.annotation.Propagation;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.util.LinkedMultiValueMap;
//import org.springframework.util.MultiValueMap;
//import org.springframework.util.ObjectUtils;
//import org.springframework.web.bind.annotation.RequestBody;
//
//@Service
//public class RTJobServiceImpl extends JobServiceImpl {
//    private  final Logger log = LoggerFactory.getLogger(com.ty.ppm.service.service.impl.job.JobServiceImpl.class);
//    public static final String PDM = "PDM";
//    public static final String OUT = "OUT";
//    public static final String REGEX = "@";
//    public static final String ERROR_MSG_LIST = "errorMsgList";
//    public static final String RELEASE_JOB_NAMES = "releaseJobNames";
//    @Resource
//    private JobService jobService;
//    @Resource
//    private RTTaskMapper rtTaskMapper;
//    @Resource
//    private JobCheckLinkService jobCheckLinkService;
//    @Resource
//    private JobDeliverLinkService jobDeliverLinkService;
//    @Resource
//    private PlanActiveService planActiveService;
//    @Resource
//    private PlanActiveOperateService planActiveOperateService;
//    @Resource
//    private MemberLinkService memberLinkService;
//    @Resource
//    private OperationRecordService operationRecordService;
//    @Resource
//    private JobCheckItemService jobCheckItemService;
//    @Resource
//    private RemoteObjectIdService remoteObjectIdService;
//    @Resource
//    private ValueConfigConstant valueConfigConstant;
//    @Resource
//    private ProjectService projectService;
//    @Resource
//    private FolderActiveLinkService folderActiveLinkService;
//    @Resource
//    private CommonConfigurationConstants configurationConstants;
//    @Resource
//    private JobDeliverService jobDeliverService;
//    @Resource
//    private RTProjectMapper rtProjectMapper;
//    @Resource
//    private ObjectSendMessageLinkService objectSendMessageLinkService;
//    @Value("${tysoft.project.AutoReceiverTaskEnabled:Y}")
//    private String autoReceiverTaskEnabled;
//
////    public JobServiceImpl() {
////    }
//
//    private QueryWrapper<Job> combineJobQueryWrapper(Job job) {
//        QueryWrapper<Job> wrapper = Wrappers.query();
//        if (Objects.isNull(job)) {
//            return wrapper;
//        } else {
////            ((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)wrapper.eq(StringUtils.isNotBlank(job.getName()), "name", job.getName())).eq(StringUtils.isNotBlank(job.getOtype()), "otype", job.getOtype())).eq(!ObjectUtils.isEmpty(job.getPlanoid()), "planoid", job.getPlanoid())).eq(!ObjectUtils.isEmpty(job.getProjectID()), "prjid", job.getProjectID())).eq(!ObjectUtils.isEmpty(job.getParentOID()), "parentnodeoid", job.getParentOID())).eq(StringUtils.isNotBlank(job.getParentOTYPE()), "parentnodeotype", job.getParentOTYPE())).eq(StringUtils.isNotBlank(job.getState()), "state", job.getState())).eq(!ObjectUtils.isEmpty(job.getActivityID()), "activityID", job.getActivityID())).eq(!Objects.isNull(job.getMarkfordelete()), "markfordelete", job.getMarkfordelete())).and(!ObjectUtils.isEmpty(job.getCreatoroid()) && !ObjectUtils.isEmpty(job.getExecutorOID()), (i) -> {
////                QueryWrapper var10000 = (QueryWrapper)((QueryWrapper)((QueryWrapper)i.eq("creatorOID", job.getCreatoroid())).or()).eq("executorOID", job.getExecutorOID());
////            });
//            return wrapper;
//        }
//    }
//
//    public List<Job> selectByOIDList(List<BigInteger> list) {
//        if (list != null && !list.isEmpty()) {
//            List<Job> resultList = new ArrayList();
//            List<List<BigInteger>> subList = ListUtils.subObjectList(list, 600);
//            Iterator var4 = subList.iterator();
//
//            while(var4.hasNext()) {
//                List<BigInteger> oidList = (List)var4.next();
//                QueryWrapper<Job> wrapper = Wrappers.query();
//                wrapper.in("oid", oidList);
//                wrapper.eq("markForDelete", 0);
//                List<Job> tempJobList = ((JobMapper)this.baseMapper).selectList(wrapper);
//                if (CollectionUtils.isNotEmpty(tempJobList)) {
//                    resultList.addAll(tempJobList);
//                }
//            }
//
//            return resultList;
//        } else {
//            return Collections.emptyList();
//        }
//    }
//
//    public List<String> queryAllJobOidList(List<BigInteger> list) {
//        return list != null && !list.isEmpty() ? ((JobMapper)this.baseMapper).queryAllJobOidList(list) : Collections.emptyList();
//    }
//
//    public int insert(Job job) {
//        return super.insert(job);
//    }
//
//    public int delete(String oid) {
//        Job job = (Job)((JobMapper)this.baseMapper).selectById(Tools.toBigInteger(oid));
//        job.setMarkfordelete(1L);
//        return ((JobMapper)this.baseMapper).updateById(job);
//    }
//
//    @Transactional(
//            rollbackFor = {Exception.class}
//    )
//    public boolean delete(List<BigInteger> list) {
//        if (list != null && !list.isEmpty()) {
//            List<List<BigInteger>> subList = ListUtils.subObjectList(list, 600);
//            Iterator var3 = subList.iterator();
//
//            while(var3.hasNext()) {
//                List<BigInteger> tempList = (List)var3.next();
//                QueryWrapper<Job> wrapper = Wrappers.query();
//                wrapper.in("oid", tempList);
//                List<Job> jobs = ((JobMapper)this.baseMapper).selectList(wrapper);
//                jobs.forEach((job) -> {
//                    job.setMarkfordelete(1L);
//                    job.setUpdatestamp(new Date());
//                    Long updateCount = job.getUpdatecount();
//                    updateCount = updateCount == null ? 0L : updateCount;
//                    job.setUpdatecount(updateCount + 1L);
//                });
//                this.updateBatchById(jobs);
//            }
//
//            return Boolean.TRUE;
//        } else {
//            return Boolean.FALSE;
//        }
//    }
//
//    public int simpleDataBaseDeleteByParams(Job job) {
//        Wrapper<Job> wrapper = this.combineJobQueryWrapper(job);
//        return wrapper.getExpression().getNormal().size() == 0 ? 0 : ((JobMapper)this.baseMapper).delete(wrapper);
//    }
//
//    public Job simpleQueryOneByParams(Job job) {
//        Wrapper<Job> wrapper = this.combineJobQueryWrapper(job);
//        return !Objects.isNull(wrapper) && !wrapper.getExpression().getNormal().isEmpty() ? (Job)this.getOne(wrapper, false) : null;
//    }
//
//    public List<Job> simpleQueryListByParams(JobDTO job) {
//        QueryWrapper<Job> wrapper = this.combineJobQueryWrapper(job);
//        ((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)wrapper.in(CollectionUtils.isNotEmpty(job.getStateList()), "state", job.getStateList())).in(CollectionUtils.isNotEmpty(job.getActivityIds()), "activityID", Tools.toBigIntegerList(job.getActivityIds()))).in(CollectionUtils.isNotEmpty(job.getCreatorIds()), "creatorOID", job.getCreatorIds())).in(CollectionUtils.isNotEmpty(job.getExecutorIds()), "executorOID", job.getExecutorIds())).in(CollectionUtils.isNotEmpty(job.getNameList()), "name", job.getNameList())).isNull(CollectionUtils.isNotEmpty(job.getEmptyFields()) && job.getEmptyFields().contains("parentnodeoid"), "parentnodeoid")).isNull(CollectionUtils.isNotEmpty(job.getEmptyFields()) && job.getEmptyFields().contains("activityID"), "activityID");
//        return wrapper.getExpression().getNormal().size() == 0 ? Collections.emptyList() : ((JobMapper)this.baseMapper).selectList(wrapper);
//    }
//
//    public Integer simpleCountByExample(JobDTO job) {
//        QueryWrapper<Job> queryWrapper = Wrappers.query();
//        ((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)queryWrapper.eq(StringUtils.isNotBlank(job.getName()), "name", job.getName())).eq(!ObjectUtils.isEmpty(job.getProjectID()), "prjid", job.getProjectID())).eq(!ObjectUtils.isEmpty(job.getPlanoid()), "planoid", job.getPlanoid())).eq("markfordelete", 0L)).eq(!ObjectUtils.isEmpty(job.getParentOID()), "parentnodeoid", job.getParentOID())).eq(ObjectUtils.isEmpty(job.getParentOID()), "parentnodeoid", (Object)null)).eq(StringUtils.isNotBlank(job.getParentOTYPE()), "parentnodeotype", job.getParentOTYPE())).eq(StringUtils.isNotEmpty(job.getState()), "state", job.getState())).notIn(CollectionUtils.isNotEmpty(job.getStateList()), "state", job.getStateList());
//        return ((JobMapper)this.baseMapper).selectCount(queryWrapper);
//    }
//
//    public List<Map<String, String>> simpleCountByJobs(List<JobDTO> jobs) {
//        List<Map<String, String>> list = new ArrayList();
//        if (CollectionUtils.isEmpty(jobs)) {
//            return list;
//        } else {
//            Map<String, Object> param = new HashMap();
//            param.put("list", jobs.stream().map(Job::getProjectID).sorted().collect(Collectors.toList()));
//            param.put("markfordelete", 0L);
//            param.put("state", ((JobDTO)jobs.get(0)).getState());
//            List<Map<String, Object>> unTerminatedJobList = ((JobMapper)this.baseMapper).getProjectIdAndState(param);
//            param.put("state", "已完成");
//            List<Map<String, Object>> completedJobList = ((JobMapper)this.baseMapper).getProjectIdAndState(param);
//            Map<String, String> map = new HashMap();
//            Iterator var7 = jobs.iterator();
//
//            while(var7.hasNext()) {
//                JobDTO jobDTO = (JobDTO)var7.next();
//                BigInteger projectOid = jobDTO.getProjectID();
//                Object unTerminatedJobCount = this.getJobCount(unTerminatedJobList, projectOid);
//                Object completedJobCount = this.getJobCount(completedJobList, projectOid);
//                map.put(String.valueOf(projectOid), completedJobCount + "/" + unTerminatedJobCount);
//            }
//
//            list.add(map);
//            return list;
//        }
//    }
//
//    private Long getJobCount(List<Map<String, Object>> jobCountList, BigInteger projectOid) {
//        if (CollectionUtils.isNotEmpty(jobCountList)) {
//            Iterator var3 = jobCountList.iterator();
//
//            while(var3.hasNext()) {
//                Map<String, Object> map = (Map)var3.next();
//                if (StringUtils.equals(String.valueOf(projectOid), String.valueOf(map.get("PRJID")))) {
//                    return Long.parseLong(map.get("COUNT").toString());
//                }
//            }
//        }
//
//        return 0L;
//    }
//
//    public List<Job> simpleQueryListNotInState(JobDTO job) {
//        QueryWrapper<Job> jobWrapper = this.combineJobQueryWrapper(job);
//        jobWrapper.notIn(CollectionUtils.isNotEmpty(job.getStateList()), "state", job.getStateList());
//        return jobWrapper.getExpression().getNormal().size() == 0 ? Collections.emptyList() : ((JobMapper)this.baseMapper).selectList(jobWrapper);
//    }
//
//    public List<Job> queryJobListByParams(@RequestBody Map<String, Object> params) {
//        return ParamValidateUtils.isNull(params) ? Collections.emptyList() : ((JobMapper)this.baseMapper).queryJobListByParams(params);
//    }
//
//    public PageInfo<Job> queryJobPageByParams(Map<String, Object> params) {
//        if (ParamValidateUtils.isNull(params)) {
//            return new PageInfo();
//        } else {
//            int pageNum = params.get("pageNum") == null ? PageConstant.DEFAULT_PAGENUM : (Integer)params.get("pageNum");
//            int pageSize = params.get("pageSize") == null ? PageConstant.DEFAULT_PAGESIZE : (Integer)params.get("pageSize");
//            PageMethod.startPage(pageNum, pageSize);
//            List<Job> jobs = ((JobMapper)this.baseMapper).queryJobListByParams(params);
//            return new PageInfo(jobs);
//        }
//    }
//
//    public PageInfo<Job> queryJobPageByParams(JobQueryDTO queryDTO) {
//        if (Objects.isNull(queryDTO)) {
//            return new PageInfo();
//        } else {
//            PageMethod.startPage(queryDTO.getPageNum(), queryDTO.getPageSize());
//            List<Job> jobs = ((JobMapper)this.baseMapper).queryJobListByParamsSimple(queryDTO);
//            return new PageInfo(jobs);
//        }
//    }
//
//    public PageInfo<Job> queryJobPageByParamsNoPage(Map<String, Object> params) {
//        if (null == params) {
//            return new PageInfo();
//        } else {
//            List<Job> jobs = ((JobMapper)this.baseMapper).queryJobListByParams(params);
//            return new PageInfo(jobs);
//        }
//    }
//
//    public List<Map<String, Object>> queryExecutorJobBadgeCountByCurrentUser(Job job) {
//        return Objects.isNull(job) ? Collections.emptyList() : ((JobMapper)this.baseMapper).queryExecutorJobBadgeCountByCurrentUser(job);
//    }
//
//    public List<Map<String, Object>> queryCreatorJobBadgeCountByCurrentUser(Job job) {
//        return Objects.isNull(job) ? Collections.emptyList() : ((JobMapper)this.baseMapper).queryCreatorJobBadgeCountByCurrentUser(job);
//    }
//
//    public boolean batchSetJobStateRecovery(Map<String, Object> params) {
//        if (ParamValidateUtils.isNull(params)) {
//            return Boolean.FALSE;
//        } else {
//            ((JobMapper)this.baseMapper).batchSetJobStateRecovery(params);
//            return Boolean.TRUE;
//        }
//    }
//
//    public boolean batchSetJobStateDesState(Map<String, Object> params) {
//        if (ParamValidateUtils.isNull(params)) {
//            return Boolean.FALSE;
//        } else {
//            ((JobMapper)this.baseMapper).batchSetJobStateDesState(params);
//            return Boolean.TRUE;
//        }
//    }
//
//    public List<Job> queryMyJobStat(Job job) {
//        return Objects.isNull(job) ? Collections.emptyList() : ((JobMapper)this.baseMapper).queryMyJobStat(job);
//    }
//
//    public PageInfo<Job> queryMonthJobListByParams(Map<String, Object> params) {
//        if (ParamValidateUtils.isNull(params)) {
//            return new PageInfo();
//        } else {
//            PageMethod.startPage((Integer)params.get("pageNum"), (Integer)params.get("pageSize"));
//            List<Job> jobs = ((JobMapper)this.baseMapper).queryMonthJobListByParams(params);
//            return new PageInfo(jobs);
//        }
//    }
//
//    public List<Map<String, Object>> queryExecutorJobBadgeCountByCurrentUserAndMonth(Map<String, Object> params) {
//        return ParamValidateUtils.isNull(params) ? Collections.emptyList() : ((JobMapper)this.baseMapper).queryExecutorJobBadgeCountByCurrentUserAndMonth(params);
//    }
//
//    public List<Map<String, Object>> getMonthJobInYearCount(int curYear) {
//        List<String> list = new ArrayList();
//
//        for(int m = 1; m <= 12; ++m) {
//            list.add(curYear + "-" + String.format("%02d", m));
//        }
//
//        List result;
//        if (CollectionUtils.isEmpty(list)) {
//            result = Collections.emptyList();
//        } else {
//            result = ((JobMapper)this.baseMapper).getMonthJobInYearCount(list);
//        }
//
//        return result;
//    }
//
//    public List<Map<String, Object>> getMonthCompletedJobInYearCount(int curYear) {
//        List<String> list = new ArrayList();
//
//        for(int m = 1; m <= 12; ++m) {
//            list.add(curYear + "-" + String.format("%02d", m));
//        }
//
//        List result;
//        if (CollectionUtils.isEmpty(list)) {
//            result = Collections.emptyList();
//        } else {
//            String state = "已完成";
//            result = ((JobMapper)this.baseMapper).getMonthCompletedJobInYearCount(list, state);
//        }
//
//        return result;
//    }
//
//    public List<Map<String, Object>> getWorkLoadSumByParams(Map<String, Object> params) {
//        return ParamValidateUtils.isNull(params) ? Collections.emptyList() : ((JobMapper)this.baseMapper).getWorkLoadSumByParams(params);
//    }
//
//    public List<Map<String, Object>> queryJobBadgeCountByProject(Map<String, Object> params) {
//        return ParamValidateUtils.isNull(params) ? Collections.emptyList() : ((JobMapper)this.baseMapper).queryJobBadgeCountByProject(params);
//    }
//
//    public List<Map<String, Object>> queryCompletedPercentageByActive(String planActiveOID) {
//        return StringUtils.isBlank(planActiveOID) ? Collections.emptyList() : ((JobMapper)this.baseMapper).queryCompletedPercentageByActive(Tools.toBigInteger(planActiveOID));
//    }
//
//    public List<String> listJobStateByActive(String activeId) {
//        return StringUtils.isNotEmpty(activeId) ? ((JobMapper)this.baseMapper).listJobStateByActive(Tools.toBigInteger(activeId)) : Collections.emptyList();
//    }
//
//    public List<JobDTO> queryRecursiveJobByOid(Job job) {
//        return Objects.isNull(job) ? Collections.emptyList() : ((JobMapper)this.baseMapper).queryRecursiveJobByOid(job);
//    }
//
//    public List<Job> getJobByPlanActiveOid(List<String> list) {
//        List<Job> result = new ArrayList();
//        List<List<String>> splitList = TyppmBatchQueryHelper.getSplitList(list);
//        Iterator var4 = splitList.iterator();
//
//        while(var4.hasNext()) {
//            List<String> strings = (List)var4.next();
//            result.addAll(((JobMapper)this.baseMapper).getJobByPlanActiveOid(Tools.toBigIntegerList(strings)));
//        }
//
//        return result;
//    }
//
//    public List<Job> getJobListByRemote(List<String> oids) {
//        List<Job> result = new ArrayList();
//        List<List<String>> splitList = TyppmBatchQueryHelper.getSplitList(oids);
//        Iterator var4 = splitList.iterator();
//
//        while(var4.hasNext()) {
//            List<String> strings = (List)var4.next();
//            result.addAll(((JobMapper)this.baseMapper).getJobListByRemote(Tools.toBigIntegerList(strings)));
//        }
//
//        return result;
//    }
//
//    public List<Job> getJobByActiveOid(List<String> list) {
//        List<Job> result = new ArrayList();
//        List<List<String>> splitList = TyppmBatchQueryHelper.getSplitList(list);
//        Iterator var4 = splitList.iterator();
//
//        while(var4.hasNext()) {
//            List<String> strings = (List)var4.next();
//            result.addAll(((JobMapper)this.baseMapper).getJobByActiveOid(Tools.toBigIntegerList(strings)));
//        }
//
//        return result;
//    }
//
//    public List<Job> getJobListByActive(List<String> activeIds) {
//        List<Job> result = new ArrayList();
//        List<List<String>> splitList = TyppmBatchQueryHelper.getSplitList(activeIds);
//        Iterator var4 = splitList.iterator();
//
//        while(var4.hasNext()) {
//            List<String> strings = (List)var4.next();
//            result.addAll(((JobMapper)this.baseMapper).getJobListByActive(Tools.toBigIntegerList(strings)));
//        }
//
//        return result;
//    }
//
//    public List<JobDTO> getJobByPrjOid(Map<String, Object> params) {
//        return ParamValidateUtils.isNull(params) ? Collections.emptyList() : ((JobMapper)this.baseMapper).getJobByPrjOid(params);
//    }
//
//    public List<JobDTO> getJobsByPrjOidList(Map<String, Object> params) {
//        return ParamValidateUtils.isNull(params) ? Collections.emptyList() : ((JobMapper)this.baseMapper).getJobsByPrjOidList(params);
//    }
//
//    public int batchUpdateJob(List<JobDTO> resultJobList) {
//        List<List<JobDTO>> splitList = ListUtils.splitListByNum(resultJobList, 600);
//        int result = 0;
//        Iterator var4 = splitList.iterator();
//        if (var4.hasNext()) {
//            List<JobDTO> jobDTOList = (List)var4.next();
//            return ((JobMapper)this.baseMapper).batchUpdateJob(jobDTOList);
//        } else {
//            return result;
//        }
//    }
//
//    public List<JobVO> getListByParams(Map<String, Object> params) {
//        return ParamValidateUtils.isNull(params) ? Collections.emptyList() : ((JobMapper)this.baseMapper).getListByParams(params);
//    }
//
//    public List<Job> getTempJobListByProject(Map<String, Object> params) {
//        return ParamValidateUtils.isNull(params) ? Collections.emptyList() : ((JobMapper)this.baseMapper).getTempJobListByProject(params);
//    }
//
//    public List<Job> queryPreWarningJob() {
//        return ((JobMapper)this.baseMapper).queryPreWarningJob();
//    }
//
//    public List<Job> queryPostWarningJob() {
//        return ((JobMapper)this.baseMapper).queryPostWarningJob();
//    }
//
//    public List<Job> recursiveUpByOid(Job job) {
//        return Objects.isNull(job) ? Collections.emptyList() : ((JobMapper)this.baseMapper).recursiveUpByOid(job);
//    }
//
//    public List<StatisticsJobVO> statisticsJobCount(Map<String, Object> params) {
//        return ParamValidateUtils.isNull(params) ? Collections.emptyList() : ((JobMapper)this.baseMapper).statisticsJobCount(params);
//    }
//
//    public boolean deleteJobByProject(String projectOid) {
//        ((JobMapper)this.baseMapper).deleteJobByProject(Tools.toBigInteger(projectOid));
//        return Boolean.TRUE;
//    }
//
//    public void updateJob(Job job, List<CheckItem> checkItemList, List<DeliverRemoteDTO> deliverRemoteList) {
//        Job oldJob = (Job)this.selectOneByOID(job.getOid());
//        int result = this.jobService.checkJobName(job.getName(), job.getProjectID(), job.getPlanoid(), job.getParentOID());
//        if (result <= 1) {
//            JobCheckLink link = new JobCheckLink();
//            link.setAoid(job.getOid());
//            link.setAotype(job.getOtype());
//            this.jobCheckLinkService.delete(link);
//            this.insertLinkList(job, checkItemList, deliverRemoteList);
//            this.planActiveService.copyJobAttributeToActiveAndSave(job);
//            this.update(job);
//            this.jobGiveAccess(job);
//            ProjectReqDTO projectReqDTO = new ProjectReqDTO();
//            projectReqDTO.setOid(job.getProjectID());
//            Project project = this.projectService.queryProjectByCondition(projectReqDTO);
//            if (!Objects.isNull(project)) {
//                this.insertUpdateJobRecord(job, oldJob, project);
//            }
//        }
//    }
//
//    private void insertUpdateJobRecord(Job job, Job oldJob, Project project) {
//        OperationRecordQC qc = new OperationRecordQC();
//        qc.setLinkOID(project.getOid());
//        qc.setLinkOTYPE(project.getOtype());
//        qc.setRefOID(job.getOid());
//        qc.setRefOTYPE(job.getOtype());
//        qc.setPassName("编辑");
//        qc.setRecordTYPE("任务编辑");
//        qc.setRefName(job.getName());
//        qc.setLinkName(project.getName());
//        if (StringUtils.isBlank(oldJob.getSecuritylabels())) {
//            if (StringUtils.isNotBlank(job.getSecuritylabels())) {
//                qc.setBeforeValue(oldJob.getSecuritylabels());
//                qc.setAfterValue(job.getSecuritylabels());
//            }
//        } else if (!oldJob.getSecuritylabels().equals(job.getSecuritylabels())) {
//            qc.setBeforeValue(oldJob.getSecuritylabels());
//            qc.setAfterValue(job.getSecuritylabels());
//        }
//
//        this.operationRecordService.insertOperationRecordForRPM(qc);
//    }
//
//    private void jobGiveAccess(Job job) {
//        if ("PDM".equals(this.valueConfigConstant.getCorporateMark())) {
//            JobDeliverLink remoteParams = new JobDeliverLink();
//            remoteParams.setAoid(job.getOid());
//            remoteParams.setAotype(job.getOtype());
//            remoteParams.setMarkfordelete(0L);
//            List<JobDeliverLink> jobDeliverLinks = this.jobDeliverLinkService.queryJobDeliverLinkByCondition(remoteParams);
//            List<BigInteger> oidListIn = new ArrayList();
//            List<BigInteger> oidListOut = new ArrayList();
//            Iterator var6 = jobDeliverLinks.iterator();
//
//            while(var6.hasNext()) {
//                JobDeliverLink jobDeliverLink = (JobDeliverLink)var6.next();
//                this.dealLink(oidListIn, oidListOut, jobDeliverLink);
//            }
//
//            List<String> docIdInList = new ArrayList();
//            List<String> docIdOut = new ArrayList();
//            this.setDoc(oidListIn, oidListOut, docIdInList, docIdOut);
//        }
//
//    }
//
//    private void dealLink(List<BigInteger> oidListIn, List<BigInteger> oidListOut, JobDeliverLink jobDeliverLink) {
//        if (CharSequenceUtil.equals(jobDeliverLink.getType(), "OUT")) {
//            if (!ObjectUtils.isEmpty(jobDeliverLink.getBoid())) {
//                oidListOut.add(jobDeliverLink.getBoid());
//            }
//        } else if (!ObjectUtils.isEmpty(jobDeliverLink.getBoid())) {
//            oidListIn.add(jobDeliverLink.getBoid());
//        }
//
//    }
//
//    private void setDoc(List<BigInteger> oidListIn, List<BigInteger> oidListOut, List<String> docIdIn, List<String> docIdOut) {
//        ArrayList remoteObjectIdsOut;
//        List splitList;
//        Iterator var7;
//        List bigIntegers;
//        RemoteObject remoteObjectId;
//        if (CollUtil.isNotEmpty(oidListIn)) {
//            remoteObjectIdsOut = new ArrayList();
//            splitList = TyppmBatchQueryHelper.getSplitList(oidListIn);
//            var7 = splitList.iterator();
//
//            while(var7.hasNext()) {
//                bigIntegers = (List)var7.next();
//                remoteObjectIdsOut.addAll(this.remoteObjectIdService.selectByOIDList(bigIntegers));
//            }
//
//            var7 = remoteObjectIdsOut.iterator();
//
//            while(var7.hasNext()) {
//                remoteObjectId = (RemoteObject)var7.next();
//                if (CharSequenceUtil.isNotBlank(remoteObjectId.getRemoteObjectId())) {
//                    docIdIn.add(remoteObjectId.getRemoteObjectId().split("@")[0]);
//                }
//            }
//        }
//
//        if (CollUtil.isNotEmpty(oidListOut)) {
//            remoteObjectIdsOut = new ArrayList();
//            splitList = TyppmBatchQueryHelper.getSplitList(oidListOut);
//            var7 = splitList.iterator();
//
//            while(var7.hasNext()) {
//                bigIntegers = (List)var7.next();
//                remoteObjectIdsOut.addAll(this.remoteObjectIdService.selectByOIDList(bigIntegers));
//            }
//
//            var7 = remoteObjectIdsOut.iterator();
//
//            while(var7.hasNext()) {
//                remoteObjectId = (RemoteObject)var7.next();
//                if (CharSequenceUtil.isNotBlank(remoteObjectId.getRemoteObjectId())) {
//                    docIdOut.add(remoteObjectId.getRemoteObjectId().split("@")[0]);
//                }
//            }
//        }
//
//    }
//
//    private void insertLinkList(Job job, List<CheckItem> checkItemList, List<DeliverRemoteDTO> deliverRemoteList) {
//        if (checkItemList != null) {
//            List<List<CheckItem>> splitList = TyppmBatchQueryHelper.getSplitList(checkItemList);
//            Iterator var5 = splitList.iterator();
//
//            while(var5.hasNext()) {
//                List<CheckItem> checkItems = (List)var5.next();
//                this.jobCheckItemService.batchInsert(checkItems);
//            }
//        }
//
//        if (deliverRemoteList != null) {
//            List<RemoteObject> remoteObjects = new ArrayList();
//            List<JobDeliverLink> jobs = new ArrayList();
//            Iterator var14 = deliverRemoteList.iterator();
//
//            while(var14.hasNext()) {
//                DeliverRemoteDTO deliverRemote = (DeliverRemoteDTO)var14.next();
//                String remoteObjectIdStr = deliverRemote.getRemoteObjectID();
//                MultiValueMap<String, String> paramMap = new LinkedMultiValueMap();
//                paramMap.add("remoteObjectId", remoteObjectIdStr);
//                RemoteObject remoteObjectId = this.remoteObjectIdService.queryByRemoteObjectId(remoteObjectIdStr);
//                if (remoteObjectId == null) {
//                    remoteObjectId = new RemoteObject();
//                    remoteObjectId.setRemoteObjectId(remoteObjectIdStr);
//                    remoteObjectId.setName(deliverRemote.getDisplayName());
//                    remoteObjects.add(remoteObjectId);
//                }
//
//                JobDeliverLink jobDeliverLink = (JobDeliverLink)this.jobDeliverLinkService.initializeEntityBase(job, remoteObjectId);
//                jobs.add(jobDeliverLink);
//            }
//
//            this.remoteObjectIdService.batchInsertRemoteObjectId(remoteObjects);
//            this.jobDeliverLinkService.batchInsertJobDeliverLink(jobs);
//        }
//
//    }
//
//    public int checkJobName(String name, BigInteger projectOid, BigInteger planOid, BigInteger parentNodeOid) {
//        JobDTO job = new JobDTO();
//        job.setName(name);
//        job.setProjectID(projectOid);
//        job.setPlanoid(planOid);
//        job.setParentOID(parentNodeOid);
//        return Math.toIntExact((long)this.jobService.simpleCountByExample(job));
//    }
//
//    public void refreshJobAndActiveExecutor(Job curJob, PlanActive planActive, boolean flag) {
//        if (flag) {
//            planActive.setExecutorOID(curJob.getExecutorOID());
//            planActive.setExecutorOTYPE(curJob.getExecutorOTYPE());
//        } else {
//            this.refreshExecutorActiveToJob(curJob, planActive, Collections.emptyList());
//        }
//
//    }
//
//    public void refreshExecutorActiveToJob(Job curJob, PlanActive planActive, List<ProjectTeamTreeDTO> projectTeamTreeDTOS) {
//        if (Objects.isNull(planActive.getExecutorOID()) && Objects.isNull(planActive.getExecutorGroupOid())) {
//            curJob.setExecutorOID((BigInteger)null);
//            curJob.setExecutorOTYPE((String)null);
//        }
//
//        if (Objects.nonNull(planActive.getExecutorOID())) {
//            curJob.setExecutorOID(planActive.getExecutorOID());
//            curJob.setExecutorOTYPE(planActive.getExecutorOTYPE());
//        } else {
//            if (Objects.nonNull(planActive.getExecutorGroupOid())) {
//                if (CollectionUtils.isEmpty(projectTeamTreeDTOS)) {
//                    projectTeamTreeDTOS = this.planActiveOperateService.queryContainerTeamByContainer(planActive.getContaineroid(), planActive.getContainerotype());
//                }
//
//                Map<BigInteger, List<TeamTreeDTO>> roleUserMap = (Map)projectTeamTreeDTOS.stream().collect(Collectors.toMap(CTyEntityBaseDO::getOid, TeamTreeDTO::getChildren));
//                curJob.setExecutorOID((BigInteger)null);
//                curJob.setExecutorOTYPE((String)null);
//                List<TeamTreeDTO> roleUsers = (List)roleUserMap.get(planActive.getExecutorGroupOid());
//                if (CollectionUtils.isNotEmpty(roleUsers) && roleUsers.size() == 1) {
//                    TeamTreeDTO user = (TeamTreeDTO)roleUsers.get(0);
//                    curJob.setExecutorOID(user.getOid());
//                    curJob.setExecutorOTYPE(user.getOtype());
//                }
//            }
//
//        }
//    }
//
//    public List<JobDTO> getJobByPrjOid(List<BigInteger> projectOidList, List<String> stateList) {
//        Map<String, Object> params = new HashMap();
//        if (CollUtil.isNotEmpty(stateList)) {
//            params.put("stateList", stateList);
//        }
//
//        params.put("projectOids", projectOidList);
//        params.put("markfordelete", 0);
//        return this.jobService.getJobByPrjOid(params);
//    }
//
//    public List<JobDTO> calculateJobDTOMap(List<JobDTO> jobList, Map<String, List<JobDTO>> activeOidJobMap) {
//        List<JobDTO> resultJobList = new ArrayList();
//        if (CollUtil.isNotEmpty(jobList)) {
//            Map<BigInteger, List<JobDTO>> prjidJobMap = (Map)jobList.stream().collect(Collectors.groupingBy(Job::getProjectID));
//            if (CollUtil.isNotEmpty(prjidJobMap)) {
//                Iterator var5 = prjidJobMap.entrySet().iterator();
//
//                while(var5.hasNext()) {
//                    Map.Entry<BigInteger, List<JobDTO>> entry = (Map.Entry)var5.next();
//                    BigInteger key = (BigInteger)entry.getKey();
//                    List<JobDTO> jobDTOS = (List)prjidJobMap.get(key);
//                    if (CollUtil.isNotEmpty(jobDTOS)) {
//                        this.jobService.builJobTree(jobDTOS, resultJobList);
//                    }
//                }
//
//                if (CollUtil.isNotEmpty(resultJobList)) {
//                    this.jobService.batchUpdateJob(resultJobList);
//                }
//            }
//        }
//
//        return resultJobList;
//    }
//
//    public List<JobDTO> builJobTree(List<JobDTO> jobList, List<JobDTO> resultJobList) {
//        List<JobDTO> trees = new ArrayList();
//        Iterator var4 = this.getRootNode(jobList).iterator();
//
//        while(var4.hasNext()) {
//            JobDTO root = (JobDTO)var4.next();
//            this.buildJobChilTree(root, jobList, resultJobList);
//            trees.add(root);
//        }
//
//        return trees;
//    }
//
//    private JobDTO buildJobChilTree(JobDTO pNode, List<JobDTO> list, List<JobDTO> resultList) {
//        List<JobDTO> children = new ArrayList();
//        Iterator var5 = list.iterator();
//
//        while(var5.hasNext()) {
//            JobDTO chil = (JobDTO)var5.next();
//            if (pNode.getOid().equals(chil.getParentOID())) {
//                children.add(this.buildJobChilTree(chil, list, resultList));
//            }
//        }
//
//        pNode.setChildren(children);
//        switch (this.valueConfigConstant.getCalculateWorkingHours()) {
//            case "completionRate":
//                this.calculatWorkingHoursTwo(pNode, resultList, children);
//                break;
//            case "workHours":
//                this.calculatWorkingHoursOne(pNode, resultList, children);
//                break;
//            default:
//                this.calculatWorkingHoursTwo(pNode, resultList, children);
//        }
//
//        return pNode;
//    }
//
//    private void calculatWorkingHoursOne(JobDTO pNode, List<JobDTO> resultList, List<JobDTO> children) {
//        LocalDateTime now = LocalDateTime.now();
//        UserDO user = TyAccountContext.getUser();
//        if (CollUtil.isEmpty(children)) {
//            if (pNode.getDurationmillis() == null || pNode.getDurationmillis() < 0L) {
//                return;
//            }
//
//            this.setPnode(pNode, resultList, now, user);
//        } else {
//            Long doneeffortmillis = 0L;
//            Long duration = 0L;
//            this.setPnode(pNode, resultList, children, now, user, doneeffortmillis, duration);
//        }
//
//    }
//
//    private void setPnode(JobDTO pNode, List<JobDTO> resultList, List<JobDTO> children, LocalDateTime now, UserDO user, Long doneeffortmillis, Long duration) {
//        Long durationmillis;
//        for(Iterator var8 = children.iterator(); var8.hasNext(); duration = duration + durationmillis) {
//            JobDTO chil = (JobDTO)var8.next();
//            durationmillis = chil.getRatedHours() != null && chil.getRatedHours() >= 0L ? chil.getRatedHours() : 0L;
//            Long doneefmillis = chil.getDoneeffortmillis() != null && chil.getDoneeffortmillis() >= 0L ? chil.getDoneeffortmillis() : 0L;
//            doneeffortmillis = doneeffortmillis + doneefmillis;
//        }
//
//        if (duration > 0L) {
//            pNode.setDoneeffortmillis(doneeffortmillis);
//            pNode.setDurationmillis(duration);
//            pNode.setRatedHours(duration);
//            pNode.setPercentWorkComplete((double)doneeffortmillis / duration.doubleValue());
//            pNode.setUpdatecount(pNode.getUpdatecount() + 1L);
//            pNode.setUpdatestamp(new DateTime(now));
//            pNode.setModifystamp(new DateTime(now));
//            pNode.setUpdatoroid(user.getOid());
//            pNode.setUpdatorotype(user.getOtype());
//            resultList.add(pNode);
//        }
//    }
//
//    private void setPnode(JobDTO pNode, List<JobDTO> resultList, LocalDateTime now, UserDO user) {
//        Long durationmillis = pNode.getRatedHours();
//        Long doneeffortmillis = pNode.getDoneeffortmillis() != null && pNode.getDoneeffortmillis() >= 0L ? pNode.getDoneeffortmillis() : 0L;
//        Double percentworkcomplete = (double)doneeffortmillis / durationmillis.doubleValue();
//        pNode.setDoneeffortmillis(doneeffortmillis);
//        pNode.setRatedHours(durationmillis);
//        pNode.setPercentWorkComplete(percentworkcomplete);
//        pNode.setDurationmillis(durationmillis);
//        pNode.setUpdatecount(pNode.getUpdatecount() + 1L);
//        pNode.setUpdatoroid(user.getOid());
//        pNode.setUpdatorotype(user.getOtype());
//        pNode.setUpdatestamp(new DateTime(now));
//        pNode.setModifystamp(new DateTime(now));
//        resultList.add(pNode);
//    }
//
//    private void calculatWorkingHoursTwo(JobDTO pNode, List<JobDTO> resultList, List<JobDTO> children) {
//        LocalDateTime now = LocalDateTime.now();
//        UserDO user = TyAccountContext.getUser();
//        if (CollUtil.isEmpty(children)) {
//            this.setPlanPnode(pNode, resultList, now, user);
//        } else {
//            this.setPnode(pNode, resultList, children, now, user);
//        }
//
//    }
//
//    private void setPnode(JobDTO pNode, List<JobDTO> resultList, List<JobDTO> children, LocalDateTime now, UserDO user) {
//        Long doneeffortmillis = 0L;
//        Long duration = 0L;
//        Double percentworkcomplete = 0.0;
//
//        Double percent;
//        for(Iterator var9 = children.iterator(); var9.hasNext(); percentworkcomplete = percentworkcomplete + percent) {
//            JobDTO chil = (JobDTO)var9.next();
//            Long doneefmillis = chil.getDoneeffortmillis() != null && chil.getDoneeffortmillis() >= 0L ? chil.getDoneeffortmillis() : 0L;
//            Long durationmillis = chil.getRatedHours() != null && chil.getRatedHours() >= 0L ? chil.getRatedHours() : 0L;
//            percent = chil.getPercentWorkComplete() != null && !(chil.getPercentWorkComplete() < 0.0) ? chil.getPercentWorkComplete() : 0.0;
//            doneeffortmillis = doneeffortmillis + doneefmillis;
//            duration = duration + durationmillis;
//        }
//
//        pNode.setDoneeffortmillis(doneeffortmillis);
//        pNode.setPercentWorkComplete(percentworkcomplete / (double)children.size());
//        pNode.setDurationmillis(duration);
//        pNode.setRatedHours(duration);
//        pNode.setUpdatecount(pNode.getUpdatecount() + 1L);
//        pNode.setUpdatestamp(new DateTime(now));
//        pNode.setModifystamp(new DateTime(now));
//        pNode.setUpdatoroid(user.getOid());
//        pNode.setUpdatorotype(user.getOtype());
//        resultList.add(pNode);
//    }
//
//    private void setPlanPnode(JobDTO pNode, List<JobDTO> resultList, LocalDateTime now, UserDO user) {
//        Long durationmillis = pNode.getRatedHours() != null && pNode.getRatedHours() >= 0L ? pNode.getRatedHours() : 0L;
//        Long doneeffortmillis = pNode.getDoneeffortmillis() != null && pNode.getDoneeffortmillis() >= 0L ? pNode.getDoneeffortmillis() : 0L;
//        Double percentworkcomplete = pNode.getPercentWorkComplete() != null && !(pNode.getPercentWorkComplete() < 0.0) ? pNode.getPercentWorkComplete() : 0.0;
//        pNode.setDoneeffortmillis(doneeffortmillis);
//        pNode.setDurationmillis(durationmillis);
//        pNode.setRatedHours(durationmillis);
//        pNode.setPercentWorkComplete(percentworkcomplete);
//        pNode.setUpdatecount(pNode.getUpdatecount() + 1L);
//        pNode.setUpdatestamp(new DateTime(now));
//        pNode.setModifystamp(new DateTime(now));
//        pNode.setUpdatoroid(user == null ? null : user.getOid());
//        pNode.setUpdatorotype(user == null ? "" : user.getOtype());
//        resultList.add(pNode);
//    }
//
//    private List<JobDTO> getRootNode(List<JobDTO> jobList) {
//        List<JobDTO> rootNodes = new ArrayList();
//        Iterator var3 = jobList.iterator();
//
//        while(var3.hasNext()) {
//            JobDTO node = (JobDTO)var3.next();
//            if (ObjectUtils.isEmpty(node.getParentOID())) {
//                rootNodes.add(node);
//            }
//        }
//
//        return rootNodes;
//    }
//
//    public Boolean batchSaveJob(List<Job> jobList) {
//        for (Job job:jobList){
//            rtProjectMapper.insertJob(job);
//        }
//        return Boolean.TRUE;
//    }
//
////    public List<Job> queryJobByJobName(CheckBatchJobDTO jobDTO) {
////        QueryWrapper<Job> queryWrapper = Wrappers.query();
////        Job job = jobDTO.getJob();
////        BigInteger projectID = jobDTO.getProjectID();
////        if (Objects.isNull(job)) {
////            ((QueryWrapper)queryWrapper.in(CollectionUtils.isNotEmpty(jobDTO.getNameList()), "name", jobDTO.getNameList())).eq(Objects.nonNull(projectID), "prjid", projectID);
////        } else {
////            ((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)((QueryWrapper)queryWrapper.in(CollectionUtils.isNotEmpty(jobDTO.getNameList()), "name", jobDTO.getNameList())).eq(!ObjectUtils.isEmpty(job.getProjectID()), "prjid", job.getProjectID())).eq(!ObjectUtils.isEmpty(job.getPlanoid()), "planoid", job.getPlanoid())).eq("markfordelete", 0L)).eq(!ObjectUtils.isEmpty(job.getOid()), "parentnodeoid", job.getOid())).eq(StringUtils.isNotBlank(job.getOtype()), "parentnodeotype", job.getOtype())).and(!ObjectUtils.isEmpty(job.getParentOID()), (i) -> {
////                QueryWrapper var10000 = (QueryWrapper)i.isNull("parentnodeoid");
////            })).and(!ObjectUtils.isEmpty(job.getPlanoid()), (i) -> {
////                QueryWrapper var10000 = (QueryWrapper)i.isNull("planoid");
////            });
////        }
////
////        return CollectionUtils.isEmpty(queryWrapper.getExpression().getNormal()) ? Collections.emptyList() : ((JobMapper)this.baseMapper).selectList(queryWrapper);
////    }
//
//    @Transactional
//    public Integer updateByJob(Job job) {
//        return job == null ? 0 : this.update(job);
//    }
//
//    @Transactional
//    public boolean batchUpdateByJob(List<Job> jobList) {
//        return CollectionUtils.isEmpty(jobList) ? false : this.saveOrUpdateBatch(jobList);
//    }
//
//    @Transactional(
//            propagation = Propagation.REQUIRES_NEW
//    )
//    public boolean batchUpdateByJobNoTransaction(List<Job> jobList) {
//        return this.batchUpdateByJob(jobList);
//    }
//
//    public Job getExistJobOneByActive(BigInteger activeOid) {
//        JobDTO jobDTO = new JobDTO();
//        jobDTO.setActivityID(activeOid);
//        jobDTO.setMarkfordelete(0L);
//        List<Job> jobs = this.simpleQueryListByParams(jobDTO);
//        return ObjectUtils.isEmpty(jobs) ? null : (Job)jobs.get(NumberUtils.INTEGER_ZERO);
//    }
//
//    public List<Map<String, Object>> queryMyJobBadgeCount(Map<String, Object> params) {
//        return ParamValidateUtils.isNull(params) ? Collections.emptyList() : ((JobMapper)this.baseMapper).queryMyJobBadgeCount(params);
//    }
//
//    public List<Job> listJobNameByPrjIdAndParentId(JobDTO jobDTO) {
//        return jobDTO == null ? Collections.emptyList() : ((JobMapper)this.baseMapper).listJobNameByPrjIdAndParentId(jobDTO);
//    }
//
//    @Transactional
//    public String batchReleaseJob(List<String> ids) {
//        return this.jobDeliverService.batchReleaseJob(ids);
//    }
//
//    @Transactional
//    public Job setJobUnread(PlanActivePublishDTO publishDTO) {
//        return this.jobDeliverService.setJobUnread(publishDTO);
//    }
//
//    public boolean batchSetJobStatePaused(Map<String, Object> params) {
//        if (ParamValidateUtils.isNull(params)) {
//            return Boolean.FALSE;
//        } else {
//            ((JobMapper)this.baseMapper).batchSetJobStatePaused(params);
//            return Boolean.TRUE;
//        }
//    }
//
////    public PageInfo<Job> queryJobByCurrentUser(ExecuteJobDTO executeJobDTO) {
////        PageMethod.startPage(executeJobDTO.getPageNum(), executeJobDTO.getPageSize());
////        return new PageInfo(((JobMapper)this.baseMapper).queryJobByCurrentUser(executeJobDTO));
////    }
//
//    public List<Map<String, String>> getJobStateCountByProject(BigInteger projectId) {
//        return ((JobMapper)this.baseMapper).getJobStateCountByProject(projectId);
//    }
//
//    public Map<String, String> queryJobNamePath(List<String> jobOidList) {
//        if (CollectionUtils.isEmpty(jobOidList)) {
//            return new HashMap();
//        } else {
//            List<JobDTO> jobDTOList = ((JobMapper)this.baseMapper).queryJobNamePath(Tools.toBigIntegerList(jobOidList));
//            return (Map)jobDTOList.stream().collect(Collectors.toMap((jobDTO) -> {
//                return Tools.toString(jobDTO.getOid());
//            }, JobDTO::getJobNamePath, (k1, k2) -> {
//                return k1;
//            }));
//        }
//    }
//
//
//
//
//
//    @Primary
//    public PageInfo<Job> queryJobByCurrentUser(ExecuteJobDTO executeJobDTO) {
//        BigInteger priattr=new BigInteger("720993539668492288");
//        List<Job> typpmJobDTOCount = rtTaskMapper.queryExecutorJobByCurrentUser(executeJobDTO.getStateList(),
//                                                                            new BigInteger(
//                                                                                    executeJobDTO.getExecutorOID()),
//                                                                            priattr);
//        int total = typpmJobDTOCount.size();
//
//        PageMethod.startPage(executeJobDTO.getPageNum(), executeJobDTO.getPageSize());
//        List<Job> typpmJobDTOS = rtTaskMapper.queryExecutorJobByCurrentUser(executeJobDTO.getStateList(),
//                                                                                    new BigInteger(
//                                                                                            executeJobDTO.getExecutorOID()),
//                                                                                    priattr);
//        List<JobDTO> typpmJobDTO =new ArrayList<>();
//        for (Job job : typpmJobDTOS){
//            JobDTO typpmJobDT = new JobDTO();
//            BeanUtils.copyProperties(job,typpmJobDT);
//            typpmJobDT.setPlanoid(job.getPlanoid());
//            typpmJobDT.setUpdatoroid(job.getUpdatoroid());
//            typpmJobDT.setExecutorOID(job.getExecutorOID());
//            typpmJobDT.setExecutorOTYPE(job.getExecutorOTYPE());
//            typpmJobDT.setCreatoroid(job.getCreatoroid());
//            typpmJobDT.setCreatorotype(job.getCreatorotype());
//            typpmJobDT.setOwnerGroupOid(job.getOwnerGroupOid());
//            typpmJobDT.setOwnerotype(job.getOwnerGroupOtype());
//           // typpmJobDT.setOwnerOID(job.getOwneroid().toString());
//            typpmJobDT.setOwnerGroupOid(job.getOwnerGroupOid());
//            typpmJobDT.setExecutorGroupOid(job.getExecutorGroupOid());
//            typpmJobDT.setStartdate(job.getStartdate());
//            typpmJobDT.setFinishdate(job.getFinishdate());
//            typpmJobDT.setActualstartdate(job.getActualstartdate());
//            typpmJobDT.setSchedule(job.getSchedule());
//            typpmJobDT.setActivityID(job.getActivityID());
//            BigInteger prjId = rtTaskMapper.selectPrjByID(job.getOid().toString());
//            typpmJobDT.setProjectID(prjId);
//
//
//            typpmJobDTO.add(typpmJobDT);
//
//        }
//        PageInfo pageInfo = new PageInfo(typpmJobDTO);
//        pageInfo.setTotal(total);
//        return pageInfo;
//    }
//
//}
